package com.jml;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

//nacos当做注册中心
@SpringBootApplication
public class AppOrder {
    public static void main(String[] args) {
        SpringApplication.run(AppOrder.class);
    }

    @Bean
    @LoadBalanced  //加入@LoadBalanced就是使用ribbon实现负载均衡
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
